#!/bin/sh

set -e

SYNTAX='/usr/share/mc/syntax/Syntax'

if [ "purge" = "$1" ]; then
	# Remove init symlinks
	#
	update-rc.d magenta remove >/dev/null

	# Unpatch mcedit's syntax
	#
	if [ -f "$SYNTAX" ]; then
		sed -i -e '/^file \.\.\\\*\\\\\.(magenta)$ Magenta\\srules ^##magenta\$/ d' -e '/^include magenta.syntax$/ d' "$SYNTAX"
	fi
fi

exit 0
